﻿Imports BUS
Imports DTO
Public Class frmTHONGTINKHACHHANG
    Dim khbus As KhachHangBUS = New KhachHangBUS


    Private Sub frmTHONGTINKHACHHANG_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        LoadDskh()
        loadcbbkh()
    End Sub

    Private Sub loadcbbkh()
        cbb_makh.DataSource = khbus.LoaddsKH()
        cbb_makh.DisplayMember = "TenKH"
        cbb_makh.ValueMember = "MaKH"
    End Sub
    Private Sub LoadDskh()
        dgv_khachhang.DataSource = khbus.LoaddsKH()
    End Sub


    Private Sub btn_thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_thoat.Click
        Me.Close()
    End Sub

    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        frmTHEMKHACHHANG.Show()
        Me.Hide()
    End Sub

    Private Sub cbb_makh_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbb_makh.SelectedIndexChanged
        Dim masp As Integer
        masp = cbb_makh.SelectedValue
        dgv_khachhang.DataSource = khbus.LoaddsKHTheoMA(masp)
    End Sub
End Class